<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="org.openfans.util.ThreadFans"%>
<%@ page import="org.openfans.domain.PreFans"%>
<%@ page import="org.openfans.domain.Fans"%>
<%
	String fansDisplay = null;
	String preFansDisplay = null;
	boolean login=false;
	if (ThreadFans.get() instanceof PreFans) {		
		fansDisplay = "none";
		preFansDisplay = "inline";
	} else {
		login=true;
		fansDisplay = "inline";
		preFansDisplay = "none";
	}
%>

<a
	href="http://groups.google.com/group/openfans" target="_blank">站务论坛</a>&nbsp;&nbsp;|
<span style="display:<%=preFansDisplay%>;" id="spanPreFans">
<a href="html/ajaxLogin.htm?height=150&width=300" class="thickbox" title="请登录">登录</a>| <a href="regist.html">注册</a></span>

<span id="spanFans" style="display:<%=fansDisplay%>;">
<a
	href="editFans.html">管理</a>．<a
	href="javascript:doLogout()">登出</a></span>&nbsp;&nbsp;
<span id="welcomeBar"><%=ThreadFans.get() .getNickName() %>,欢迎来到Openfans</span>
   <script>
   
   var login=<%=login%>;
   
   function doLogout(){
   		if(!confirm("你真的希望登出吗?")) return;
	   var xmlhttp = getHttpRequest();
		xmlhttp.open("get","logout.ajax",false);
		xmlhttp.send("");
		login=false;
		$$("spanPreFans").style.display="inline";
	    $$("spanFans").style.display="none";
	    $$("welcomeBar").innerHTML="访客,欢迎来到Openfans";     
   } 
</script>
